package com.bsoft.hospitalchs.api;


import com.bsoft.hospitalchs.model.CharacterBean;
import com.bsoft.hospitalchs.model.CharacterResBean;
import com.bsoft.hospitalchs.model.ChildCaseRes;
import com.bsoft.hospitalchs.model.ChildRecordList;
import com.bsoft.hospitalchs.model.InspectBean;
import com.bsoft.hospitalchs.model.PhotoResBean;
import com.bsoft.hospitalchs.model.PicResBean;
import com.bsoft.hospitalchs.model.PicSaveInfoBean;
import com.bsoft.hospitalchs.model.RecordInfo;
import com.bsoft.hospitalchs.model.RecordResBean;
import com.bsoft.hospitalchs.model.SearchBean;
import com.bsoft.hospitalchs.model.SearchListReq;
import com.bsoft.hospitalchs.model.SearchResBean;
import com.bsoft.hospitalchs.model.SearchResList;
import com.google.gson.JsonObject;

import java.io.File;
import java.util.Map;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.Url;
import rx.Observable;

/**
 * Created by 泅渡者
 * Created on 2017/3/22.
 * Api 网络层接口
 */

public interface  ApiService {

    @GET
    Observable<File> getVersionFile(@Url String url);

    @POST("logon/myRoles")
    Observable<CharacterResBean> getCharacter(@Body CharacterBean bean);

    @POST("logon/myApps")
    @FormUrlEncoded
    Observable<JsonObject> getLogin(@Field("urt") String urt, @Field("uid") String uid, @Field("pwd") String pwd, @Field("deep") String deep, @Field("forceLogon") String forceLogon);

    @POST("*.jsonRequest")
    Observable<SearchResBean> getSearch(@Body SearchBean bean);
    @POST("*.jsonRequest")
    Observable<SearchResList> getSearchList(@Body SearchListReq bean);

    @POST("*.jsonRequest")
    Observable<JsonObject> toSavePreflight(@Body InspectBean bean);

    @POST("*.jsonRequest")
    Observable<JsonObject> toSavePicInfo(@Body PicSaveInfoBean bean);

    @Multipart
    @POST("*.mobileUploadForm")
    Observable<PicResBean> updateUser(@PartMap Map<String, RequestBody> params);

    @GET
    Call<ResponseBody> retrofitDownload(@Url String fileUrl);


    @POST("*.jsonRequest")
    Observable<RecordResBean> getRecord(@Body RecordInfo recordInfo);

    @POST("*.jsonRequest")
    Observable<PhotoResBean> getPhotoInfo(@Body RecordInfo recordInfo);

    @POST("*.jsonRequest")
    Observable<ChildRecordList> getRecordList(@Body RecordInfo recordInfo);

    @GET
    Observable<ChildCaseRes> getCaseList(@Url String fileUrl);
}
